Optimal. Leaf size=102 \[ -\frac {a^3 \cot (c+d x)}{d}+a^3 (-x)+\frac {3 a^2 b \cos (c+d x)}{d}-\frac {3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}+\frac {3 a b^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} a b^2 x-\frac {b^3 \cos ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 9, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {2722, 2635, 8, 2592, 321, 206, 3473, 2565, 30} \[ \frac {3 a^2 b \cos (c+d x)}{d}-\frac {3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}+a^3 (-x)+\frac {3 a b^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} a b^2 x-\frac {b^3 \cos ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 206
Rule 321
Rule 2565
Rule 2592
Rule 2635
Rule 2722
Rule 3473
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx &=\int \left (3 a b^2 \cos ^2(c+d x)+3 a^2 b \cos (c+d x) \cot (c+d x)+a^3 \cot ^2(c+d x)+b^3 \cos ^2(c+d x) \sin (c+d x)\right ) \, dx\\ &=a^3 \int \cot ^2(c+d x) \, dx+\left (3 a^2 b\right ) \int \cos (c+d x) \cot (c+d x) \, dx+\left (3 a b^2\right ) \int \cos ^2(c+d x) \, dx+b^3 \int \cos ^2(c+d x) \sin (c+d x) \, dx\\ &=-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d}-a^3 \int 1 \, dx+\frac {1}{2} \left (3 a b^2\right ) \int 1 \, dx-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}-\frac {b^3 \operatorname {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a^3 x+\frac {3}{2} a b^2 x+\frac {3 a^2 b \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d}-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a^3 x+\frac {3}{2} a b^2 x-\frac {3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}+\frac {3 a^2 b \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.32, size = 143, normalized size = 1.40 \[ \frac {-6 a^3 \cot \left (\frac {1}{2} (c+d x)\right )+\left (36 a^2 b-3 b^3\right ) \cos (c+d x)+6 a \left (a^2 \tan \left (\frac {1}{2} (c+d x)\right )-2 a^2 c-2 a^2 d x+6 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-6 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+3 b^2 c+3 b^2 d x\right )+9 a b^2 \sin (2 (c+d x))-b^3 \cos (3 (c+d x))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.71, size = 143, normalized size = 1.40 \[ -\frac {9 \, a b^{2} \cos \left (d x + c\right )^{3} + 9 \, a^{2} b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 9 \, a^{2} b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) + {\left (2 \, b^{3} \cos \left (d x + c\right )^{3} - 18 \, a^{2} b \cos \left (d x + c\right ) + 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} d x\right )} \sin \left (d x + c\right )}{6 \, d \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.24, size = 199, normalized size = 1.95 \[ \frac {18 \, a^{2} b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )} - \frac {3 \, {\left (6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 18 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 6 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 36 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 18 \, a^{2} b + 2 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.40, size = 125, normalized size = 1.23 \[ -a^{3} x -\frac {a^{3} \cot \left (d x +c \right )}{d}-\frac {a^{3} c}{d}+\frac {3 a^{2} b \cos \left (d x +c \right )}{d}+\frac {3 a^{2} b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {3 a \,b^{2} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {3 a \,b^{2} x}{2}+\frac {3 a \,b^{2} c}{2 d}-\frac {b^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 95, normalized size = 0.93 \[ -\frac {4 \, b^{3} \cos \left (d x + c\right )^{3} + 12 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{3} - 9 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2} - 18 \, a^{2} b {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.47, size = 289, normalized size = 2.83 \[ \frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )\,\left (\frac {a\,b^2\,3{}\mathrm {i}}{2}-a^3\,1{}\mathrm {i}\right )}{d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (12\,a^2\,b-\frac {4\,b^3}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (a^3+6\,a\,b^2\right )-3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a\,b^2-3\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (12\,a^2\,b-4\,b^3\right )-a^3+24\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {3\,a^2\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )\,\left (2\,a^2-3\,b^2\right )\,1{}\mathrm {i}}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________